1. Field of the Invention
The present invention relates to peripheral devices. Specifically, the present invention relates to a method and apparatus for updating firmware of a peripheral device.
2. Description of the Related Art
A peripheral device is a device that is coupled to a computer to perform a given function. Peripheral devices are often located external to the computer housing. Peripheral devices may include, for example, optical drives, magnetic disc drives, hard drives, DVD drives, internal and external modems, Personal Digital Assistants (PDAs), solid state memories, network interfaces, video cameras, digital cameras, printers, scanners, fax machines, and the like.
In many peripheral devices, firmware is the executable code and associated data that control the operation of a peripheral device. Conventionally, firmware is stored in a nonvolatile memory of the peripheral device. Some peripheral devices allow the host computer to transmit firmware updates to the peripheral device via a peripheral device bus. Firmware updates may be made available, for example, to eliminate bugs or to add new functions to the peripheral device.
The transmission of a firmware update may become interrupted if the peripheral device receives a reset signal during the transmission. A number of different circumstances may cause the peripheral device to receive a reset signal during the transmission of a firmware update. For example, the host computer may send a reset signal to the peripheral device if the user resets the host computer or if the host computer temporarily loses power. In addition, if the peripheral device bus becomes disconnected from the peripheral device, the peripheral device bus may send a reset signal to the peripheral device when the peripheral device bus is reconnected.
If a peripheral device receives a reset signal during the transmission of a firmware update, then the peripheral device may store an incomplete portion of the update in the peripheral device""s nonvolatile memory. Storage of an incomplete portion of a firmware update may cause the data stored in the nonvolatile memory of the peripheral device to become corrupted, which may cause the peripheral device to malfunction.
The present invention advantageously provides systems and methods for ensuring that firmware updates are performed reliably. In one embodiment of the present invention, a signal which could interfere with a firmware download or update process of a peripheral device is blocked during the firmware update process. Thus, by way of example, a reset signal is masked in response to a firmware update command.
In one embodiment, the peripheral device includes a processor, such as a microprocessor or a microcontroller, a volatile memory, and a nonvolatile memory. The microcontroller is used to transfer the firmware update from the volatile memory to the nonvolatile memory. Conventionally, if the microcontroller is reset during the transfer, the transfer is corrupted. Using one embodiment of the present invention, the reset signal to the microcontroller is masked during the firmware update, thereby ensuring the transfer is not interrupted.
In one embodiment of the invention, a method of storing a firmware update in a nonvolatile memory of a peripheral device includes the acts of receiving a firmware update command, receiving the firmware update data from a host computer, and storing the firmware update in a volatile memory of the peripheral device. In addition, the accuracy of the firmware update stored in the volatile memory is verified. A reset signal going to a firmware update circuit is masked. In addition, a timer is started. The firmware update is stored in the nonvolatile memory while the reset signal is masked. Once the timer reaches a first count, an indication that the firmware update is stored in the nonvolatile memory is provided. The reset signal is unmasked.
In another embodiment, a method of storing a firmware update in a nonvolatile memory of a peripheral device includes masking a reset signal in response to a firmware update command and storing the firmware update in the nonvolatile memory while the reset signal is masked.
In still another embodiment, a peripheral device couplable to a host computer includes firmware update circuitry, a firmware update detector configured to detect a firmware update command, and a reset signal masker configured to prevent the firmware update circuitry from receiving the reset signal during a firmware update process.
In yet another embodiment, a peripheral device, couplable to a host computer, includes firmware update circuitry, a firmware update detector configured to detect a firmware update command, and a means for blocking a reset signal from reaching the firmware update circuitry during a firmware update process.
In one embodiment, a method of downloading firmware to a peripheral device includes the acts of receiving a firmware transfer indication, preventing a reset signal from resetting at least a portion of the peripheral device in response to at least the firmware transfer indication, and allowing the reset signal to reset at least the portion of the peripheral device after the firmware transfer is complete.
In another embodiment, a computer system includes a host computer configured to provide a firmware update, a bus, configured to transfer a firmware update, couplable to the host computer, and a peripheral device couplable to the bus. The peripheral device includes firmware update circuitry, a firmware update detector configured to detect a firmware update command, and a reset signal masker configured to prevent the firmware update circuitry from receiving a signal during a firmware update process.
For purposes of summarizing the invention, certain aspects advantages and novel features of the invention are described herein. It is to be understood that not necessarily all such advantages may be achieved in accordance with any particular embodiment of the invention. Thus, for example, those skilled in the art will recognize that the invention may be embodied or carried out in a manner that achieves one advantage or group of advantages as taught herein without necessarily achieving other advantages as may be taught or suggested herein.